import { Router2 } from "../addons/router";
import { withAuth } from "../services/sercurity";
import { json } from "itty-router";

const router = Router2({ base: "/test" });
export default { base: "/test/*", handle: router.handle };

router.all("/login", async (request, args) => {
  try {
    withAuth(request, args);
    return json({ result: true });
  } catch (error) {
    return json({ result: false });
  }
});
